<template>
  <div class="edit-bar" v-bind="$attrs">
    <span v-for="(item, key) in options" :key="key" @click="handleClick(item)">
      {{ item.name }}
    </span>
    <!-- 隐藏/开启模块逻辑写在这里 -->
    <!-- ...... -->
  </div>
</template>
<script>
import bus from '@/utils/bus'
export default {
  name: 'editBar',
  props: {
    options: {
      required: true,
      type: Array,
      default: () => []
    }
  },
  methods: {
    handleClick(item) {
      bus.$emit(item.emit, item)
    }
  }
}
</script>
<style lang="stylus">
.edit-bar {
  position: absolute;
  top: 0;
  left: 0;
  margin-top: -22px;
}
</style>
